
#include "app/event_loop.h"
#include "core/logs.h"

#include <windows.h>

extern VEEventCallbacks g_event_callbacks;

void ve_event_loop_run()
{
	MSG msg;

	while( 1 )
	{
		if( PeekMessage( &msg, 0, 0, 0, PM_REMOVE ) )
		{
			if( msg.message == WM_QUIT )
				return;

			TranslateMessage( &msg );
			DispatchMessage( &msg );
		}
		else
		{
			if( g_event_callbacks.idle )
				g_event_callbacks.idle();
		}
	}
}
